import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'
dayjs.extend(relativeTime)

export default {
	handlTime(val) { //XX前
		return dayjs(new Date(val)).locale('zh-cn').fromNow()
	},
	getDate(val) {
		return dayjs(new Date(val)).format('YYYY年MM月DD日 HH:mm')
	}
}